package com.example.myapplication.HomeActivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

import com.example.myapplication.HomeActivity.HomeGVShop.HomeGVDaoDan;
import com.example.myapplication.HomeActivity.HomeGVShop.HomeGVHuoPao;
import com.example.myapplication.HomeActivity.HomeGVShop.HomeGVQianTing;
import com.example.myapplication.HomeActivity.HomeGVShop.HomeGVWuRenJi;
import com.example.myapplication.R;

public class HomeGridViewActity extends AppCompatActivity {
    Bundle bundle;
    Intent intent=new Intent();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_homegridview);
        bundle=getIntent().getExtras();
        String name=bundle.getString("name");
        switch(name){
            case "火炮":
                intent.setClass(HomeGridViewActity.this, HomeGVHuoPao.class);
                startActivity(intent);
                Toast.makeText(HomeGridViewActity.this,"1",Toast.LENGTH_LONG).show();
                break;
            case "无人机":
                intent.setClass(HomeGridViewActity.this, HomeGVWuRenJi.class);
                startActivity(intent);
                Toast.makeText(HomeGridViewActity.this,"2",Toast.LENGTH_LONG).show();
                break;
            case "导弹":
                intent.setClass(HomeGridViewActity.this, HomeGVDaoDan.class);
                startActivity(intent);
                Toast.makeText(HomeGridViewActity.this,"3",Toast.LENGTH_LONG).show();
                break;
            case "潜艇":
                intent.setClass(HomeGridViewActity.this, HomeGVQianTing.class);
                startActivity(intent);
                Toast.makeText(HomeGridViewActity.this,"4",Toast.LENGTH_LONG).show();
                break;
        }

    }
}